package com.diploma.project.aiqiyi.common.config.feign.codec;

import feign.Response;
import feign.codec.Decoder;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Objects;

@Slf4j
public final class FeignDecoder implements Decoder {

    final Decoder delegate;

    public FeignDecoder(Decoder delegate) {
        Objects.requireNonNull(delegate, "Decoder must not be null. ");
        this.delegate = delegate;
    }

    @Override
    public Object decode(Response response, Type type) throws IOException {
        return delegate.decode(response, type);
    }
}